import { message } from 'ant-design-vue';

import { checkCreatSiteForm } from "./formRuler";
// isBoolean:true, // 是否为Boolean类型, 参数是否必须为boolen类型，不是根据options个数判断，是根据后台字段类型要求判断
const sysSettingForm = [
  {
    value: '前台用户注册设置',
    type: 'title',
    id: 'frontUserRegisterSettingsDto',
    children: [
      {
        value: false,
        param: 'frontUserFunction',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "是否开启前台用户功能:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
      {
        value: true,
        param: 'frontUserRegister',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "是否允许前台用户自注册:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
        associated: 'frontUserFunction',
        associatedValue: true,
      },
      {
        value: false,
        param: 'memberRegisterNeedPictureVerificationCode',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "会员注册是否需要图片验证码:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
        associated: 'frontUserFunction,frontUserRegister',
        associatedValue: true,
      },
      {
        value: true,
        param: 'memberRegisterNeedExamine',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "会员注册是否需要审核:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
        associated: 'frontUserFunction,frontUserRegister',
        associatedValue: true,
      },
    ]
  },

  {
    value: '第三方登录配置',
    type: 'title',
    id: 'thirdPartyLoginSettingsDto',
    children: [
      {
        value: false,
        param: 'qqLoginOpen',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        optionsObj: {},
        label: "是否开启QQ登录:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'qqLoginAppId',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "应用ID:",
        beforeText: '',
        afterText: '',
        otherInfo: '点击获取应用',
        href: 'https://connect.qq.com/',
        marginLeft: 32,
        type: 'textInput',
        associated: 'qqLoginOpen',
        associatedValue: true,
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'qqLoginAppKey',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "应用秘钥:",
        beforeText: '',
        afterText: '',
        marginLeft: 32,
        type: 'textInput',
        associated: 'qqLoginOpen',
        associatedValue: true,
      },

      {
        value: false,
        param: 'weChatLoginOpen',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        optionsObj: {},
        label: "是否开启微信登录:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'weChatLoginAppId',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "应用ID:",
        beforeText: '',
        afterText: '',
        marginLeft: 32,
        otherInfo: '点击获取应用',
        href: 'https://open.weixin.qq.com/',
        type: 'textInput',
        associated: 'weChatLoginOpen',
        associatedValue: true,
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'weChatLoginAppKey',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "应用秘钥:",
        beforeText: '',
        afterText: '',
        marginLeft: 32,
        type: 'textInput',
        associated: 'weChatLoginOpen',
        associatedValue: true,
      },

      {
        value: false,
        param: 'microBlogLoginOpen',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        optionsObj: {},
        label: "是否开启微博登录:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'microBlogLoginAppId',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "应用ID:",
        beforeText: '',
        afterText: '',
        otherInfo: '点击获取应用',
        href: 'https://open.weibo.com/index.php',
        marginLeft: 32,
        type: 'textInput',
        associated: 'microBlogLoginOpen',
        associatedValue: true,
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'microBlogLoginAppKey',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "应用秘钥:",
        beforeText: '',
        afterText: '',
        marginLeft: 32,
        type: 'textInput',
        associated: 'microBlogLoginOpen',
        associatedValue: true,
      },
    ]
  },

  {
    value: '内容配置',
    type: 'title',
    id: 'contentSettingsDto',
    children: [
      // {
      //   value: true,
      //   param: 'contentSecurity',
      //   rule: {
      //     required: false,
      //     validator: checkCreatSiteForm,
      //     trigger: ["blur"],
      //     msg1: '',
      //     msg2: '',
      //     api: "",
      //     key: 'siteDomain',
      //     params: {}, //校验传参
      //   },
      //   label: "是否开启内容密级:",
      //   showRadioPop: true,
      //   type: 'radio',
      //   isBoolean: true, // 是否为Boolean类型
      //   options: ['是', '否'],
      //   tips: '',
      // },
      // {
      //   value: false,
      //   param: 'enclosureSecurity',
      //   rule: {
      //     required: false,
      //     validator: checkCreatSiteForm,
      //     trigger: ["blur"],
      //     msg1: '',
      //     msg2: '',
      //     api: "",
      //     key: 'siteDomain',
      //     params: {}, //校验传参
      //   },
      //   label: "是否开启附件密级:",
      //   type: 'radio',
      //   isBoolean: true, // 是否为Boolean类型
      //   options: ['是', '否'],
      //   tips: '',
      // },
      {
        value: false,
        param: 'contentIssue',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "是否开启内容索引号:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
      // {
      //   value: '新增分隔符',
      //   param: 'selectContent',
      //   rule: {
      //     required: false,
      //     //validator: checkCreatSiteForm,
      //     trigger: ["blur"],
      //     msg1: '',
      //     msg2: '',
      //     api: "",
      //     key: 'siteDomain',
      //     params: {}, //校验传参
      //   },
      //   label: "",
      //   marginLeft: 0,
      //   isAddSplit: true,
      //   type: 'addDomain',
      //   isBoolean: false, // 是否为Boolean类型
      //   tips: '',
      // },
      {
        value: [],
        param: 'indexNumSetting',
        rule: {
          required: false,
          //validator: checkCreatSiteForm,
          trigger: ["blur"],
          message: 'dhwjehdew'
          // msg1: '',
          // msg2: '',
          // api: "",
          // key: 'siteDomain',
          // params: {}, //校验传参
        },
        label: "索引号生成设置:",
        marginLeft: 0,
        type: 'addDomain_associated',
        isBoolean: false, // 是否为Boolean类型
        tips: '',
        associated: 'contentIssue',
        associatedValue: true,
      },
      {
        value: 1,
        param: 'sequenceNumberGenerationRules',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "顺序号生成规则:",
        type: 'radio',
        isBoolean: false, // 是否为Boolean类型
        options: ['按发文机关内同年创建顺序生成', '按基础分类内同年创建顺序生成'],
        tips: '',
        associated: 'contentIssue',
        associatedValue: true,
      },
      {
        value: '',
        placeholder: '请选择',
        param: 'contributeModelId',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '投稿模型不能为空！',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "投稿模型选择:",
        beforeText: '',
        afterText: '',
        marginLeft: 32,
        type: 'multipleSelect',
        options: [],
        mode: 'single',
      },
    ]
  },
  {
    value: '系统部署配置',
    type: 'title',
    id: 'sysDeploySettingsDto',
    children: [
      // {
      //   value: '',
      //   placeholder: '请输入',
      //   param: 'deploymentPath',
      //   rule: {
      //     required: false,
      //     validator: checkCreatSiteForm,
      //     trigger: ["blur"],
      //     msg1: '1111',
      //     msg2: '',
      //     api: "",
      //     key: 'siteDomain',
      //     params: {}, //校验传参
      //   },
      //   label: "部署路径:",
      //   beforeText: '',
      //   afterText: '',
      //   extra: '若部署在根目录，此处置空',
      //   type: 'textInput',
      //   associated: '',
      //   associatedValue: '',
      // },
      {
        value: '',
        placeholder: '请输入',
        param: 'port',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "端口号:",
        beforeText: '',
        afterText: '',
        type: 'textInput',
        associated: '',
        associatedValue: '',
      },
      {
        value: 1,
        param: 'backupFileServerType',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "数据备份文件存储服务器:",
        type: 'radio',
        isBoolean: false, // 是否为Boolean类型
        options: ['本地服务器', 'FTP', 'OSS云储存'],
        tips: '当使用集部署时，指️数据备份文件的存储位置',
      },
      {
        value:  '',
        placeholder: '请选择',
        param: 'backupFileServerTypeValue',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["change"],
          msg1: '请选择',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "FTP:",
        beforeText: '',
        afterText: '',
        marginLeft: 32,
        type: 'multipleSelect',
        options: [],
        mode: 'single',
        associated: 'backupFileServerType',
        associatedValue: 2,
      },
      {
        value: '',
        placeholder: '请选择',
        param: 'backupFileServerTypeValue',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "OSS云储存:",
        beforeText: '',
        afterText: '',
        marginLeft: 32,
        type: 'multipleSelect',
        options: [],
        mode: 'single',
        associated: 'backupFileServerType',
        associatedValue: 3,
      },
      // {
      //   value: 1,
      //   param: 'templateFileServerType',
      //   rule: {
      //     required: true,
      //     validator: checkCreatSiteForm,
      //     trigger: ["blur"],
      //     msg1: '',
      //     msg2: '',
      //     api: "",
      //     key: 'siteDomain',
      //     params: {}, //校验传参
      //   },
      //   label: "模板文件储存服务器:",
      //   type: 'radio',
      //   isBoolean: false, // 是否为Boolean类型
      //   options: ['本地服务器', 'FTP', 'OSS云储存'],
      //   tips: '',
      // },
      // {
      //   value: '',
      //   placeholder: '请选择',
      //   param: 'templateFileServerValue',
      //   rule: {
      //     required: true,
      //     validator: checkCreatSiteForm,
      //     trigger: ["blur"],
      //     msg1: '1111',
      //     msg2: '',
      //     api: "",
      //     key: 'siteDomain',
      //     params: {}, //校验传参
      //   },
      //   label: "FTP:",
      //   beforeText: '',
      //   afterText: '',
      //   marginLeft: 32,
      //   type: 'multipleSelect',
      //   options: [],
      //   mode: 'single',
      //   associated: 'templateFileServerType',
      //   associatedValue: 2,
      // },
      // {
      //   value: '',
      //   placeholder: '请选择',
      //   param: 'templateFileServerValue',
      //   rule: {
      //     required: true,
      //     validator: checkCreatSiteForm,
      //     trigger: ["blur"],
      //     msg1: '1111',
      //     msg2: '',
      //     api: "",
      //     key: 'siteDomain',
      //     params: {}, //校验传参
      //   },
      //   label: "OSS云储存:",
      //   beforeText: '',
      //   afterText: '',
      //   marginLeft: 32,
      //   type: 'multipleSelect',
      //   options: [],
      //   mode: 'single',
      //   associated: 'templateFileServerType',
      //   associatedValue: 3,
      // },
      {
        value: false,
        param: 'websiteWhiteListOpen',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "是否开启网站白名单:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
      {
        value: '',
        placeholder: '请输入域名',
        param: 'whiteList',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "自定义白名单:",
        beforeText: '',
        afterText: '',
        extra: '',
        marginLeft: 32,
        isReset: true,
        type: 'textArea',
        associated: 'websiteWhiteListOpen',
        associatedValue: true,
        tips: '默认已将本系统内所有站点所设置的域名作为白名单，可通过自定义设置添加额外的白名单',
      },
    ]
  },
  {
    value: '其他配置',
    type: 'title',
    id: 'otherSettingsDto',
    children: [
      // {
      //   value: true,
      //   param: 'orgToAllUser',
      //   rule: {
      //     required: false,
      //     validator: checkCreatSiteForm,
      //     trigger: ["blur"],
      //     msg1: '',
      //     msg2: '',
      //     api: "",
      //     key: 'siteDomain',
      //     params: {}, //校验传参
      //   },
      //   label: "组织对所有用户可见:",
      //   type: 'radio',
      //   isBoolean: true, // 是否为Boolean类型
      //   options: ['是', '否'],
      //   tips: '',
      // },
      {
        value: true,
        param: 'intranetMode',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "是否开启内网模式:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
      {
        value: true,
        param: 'contentPageQRCode',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur", "change"],
          msg1: '111111111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "是否生成内容页二维码:",
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
      {
        value: [],
        param: 'tabPic',
        picId: '',
        picIdPram: 'tabPic',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur", "change"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "系统标志:",
        beforeText: '',
        afterText: '',
        maxCount: 1,
        uploadTitle: '上传图片',
        accept: 'ico',
        extra: '请上传ico格式的图片，建议文件命名为favicon.ico',
        type: 'singlePictrueUpload',
        optionValue: '',
        associated: '',
        associatedValue: '',
      },
      {
        value: [],
        param: 'loginPagePic',
        picId: '',
        picIdPram: 'loginPagePic',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur", "change"],
          msg1: '请上传登录页logo图片！',
          msg2: '',
          api: "",
          type: 'Array',
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "登录页logo:",
        beforeText: '',
        afterText: '',
        maxCount: 1,
        uploadTitle: '上传图片',
        accept: 'png,jpg,jpeg,gif, bmp',
        extra: '请上传jpg, png, gif, bmp, jpeg格式的图片',
        type: 'singlePictrueUpload',
        optionValue: '',
        associated: '',
        associatedValue: '',
      },
      {
        value: [],
        param: 'sysHeaderLogo',
        picId: '',
        picIdPram: 'sysHeaderLogo',
        rule: {
          required: true,
          validator: checkCreatSiteForm,
          trigger: ["blur", "change"],
          msg1: '请上传系统头部logo图片！',
          msg2: '',
          api: "",
          type: 'Array',
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "系统头部logo:",
        beforeText: '',
        afterText: '',
        maxCount: 1,
        uploadTitle: '上传图片',
        accept: 'png,jpg,jpeg,gif',
        extra: '请上传png、jpg、jpeg、gif格式的图片，图片大小建议32*32PX的正方形图片',
        type: 'singlePictrueUpload',
        optionValue: '',
        associated: '',
        associatedValue: '',
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'pageTitleSetting',
        rule: {
          required: false,
          validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "网页title设置:",
        beforeText: '',
        afterText: '',
        extra: 'title设置的文案会显示在网页标签页中',
        type: 'textInput',
        associated: '',
        associatedValue: '',
      },
    ]
  },
  // {
  //   value: '储存配置',
  //   type: 'title',
  //   id: 'storageSettingsDto',
  //   children: [
  //     {
  //       value: true,
  //       param: 'uploadFileUseGlobal',
  //       rule: {
  //         required: true,
  //         validator: checkCreatSiteForm,
  //         trigger: ["blur"],
  //         msg1: '',
  //         msg2: '',
  //         api: "",
  //         key: 'siteDomain',
  //         params: {}, //校验传参
  //       },
  //       label: "是否全局使用统一存储配置:",
  //       type: 'radio',
  //       isBoolean: true, // 是否为Boolean类型
  //       options: ['是', '否'],
  //       tips: '',
  //     },
  //     {
  //       value: 1,
  //       param: 'uploadFileLocationType',
  //       rule: {
  //         required: true,
  //         validator: checkCreatSiteForm,
  //         trigger: ["blur"],
  //         msg1: '',
  //         msg2: '',
  //         api: "",
  //         key: 'siteDomain',
  //         params: {}, //校验传参
  //       },
  //       label: "上传文件储存位置选择:",
  //       type: 'radio',
  //       isBoolean: false, // 是否为Boolean类型
  //       options: ['本地服务器', 'FTP', 'OSS云储存'],
  //       tips: '',
  //     },
  //     {
  //       value: '',
  //       placeholder: '请选择',
  //       param: 'uploadFileLocationValue',
  //       rule: {
  //         required: true,
  //         validator: checkCreatSiteForm,
  //         trigger: ["blur"],
  //         msg1: '1111',
  //         msg2: '',
  //         api: "",
  //         key: 'siteDomain',
  //         params: {}, //校验传参
  //       },
  //       label: "FTP:",
  //       beforeText: '',
  //       afterText: '',
  //       marginLeft: 32,
  //       type: 'multipleSelect',
  //       options: [],
  //       mode: 'single',
  //       associated: 'uploadFileLocationType',
  //       associatedValue: 2,
  //     },
  //     {
  //       value: '',
  //       placeholder: '请选择',
  //       param: 'uploadFileLocationValue',
  //       rule: {
  //         required: true,
  //         validator: checkCreatSiteForm,
  //         trigger: ["blur"],
  //         msg1: '1111',
  //         msg2: '',
  //         api: "",
  //         key: 'siteDomain',
  //         params: {}, //校验传参
  //       },
  //       label: "OSS云储存:",
  //       beforeText: '',
  //       afterText: '',
  //       marginLeft: 32,
  //       type: 'multipleSelect',
  //       options: [],
  //       mode: 'single',
  //       associated: 'uploadFileLocationType',
  //       associatedValue: 3,
  //     },
  //   ]
  // },
]
export { sysSettingForm }